package com.qfmy.web.app.controller.listenBook;

import com.qfmy.common.result.Result;
import com.qfmy.model.vo.listenBook.AudioChapterVo;
import com.qfmy.web.app.service.listenBook.AudioChapterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.qfmy.web.app.controller.listenBook
 * @date 2025/11/01
 * @description 章节
 */
@RestController
@RequestMapping("/app/audioChapter")
public class AudioChapterController {

    /**
     * 注入service
     */
    @Autowired
    private AudioChapterService audioChapterService;

    /**
     * 根据音频id获取章节
     */
    @RequestMapping("/getAudioChapters")
    public Result<List<AudioChapterVo>> getAudioChapters(@RequestParam Integer audioId) {
        List<AudioChapterVo> list = audioChapterService.getAudioChapters(audioId);
        return Result.ok(list);
    }

}
